/*
* @Date: 2020/4/20
* @Author: XueChengwu <xuechengwu@erayt.com>
* @Copyright: 2015-2019 Erayt, Inc.
* @Description: If you have some questions, please contact: xuechengwu@erayt.com.
*/
var age = 10;
var person = {
  age: 20, getAge () {
    var age = 30;
    return this.age;
  },
};
console.log(age, age * 2);
person.getAge();
var b = person.getAge;
b();
(person.getAge)();
(1, person.getAge)();
(1, person.getAge.bind(person))();
(person.getAge, person.getAge)();
(person.getAge = person.getAge)();
person.getAge.call();
person.getAge.call(person);

function getAge2 () {
  this.age = 40;
  console.log(person.getAge());
};getAge2();
console.log(age);

function getAge3 () {
  this.age = 50;
  this.getAge4 = () => {
    console.log(person.getAge.call(this));
  }
}

new getAge3().getAge4();
console.log(age);

function getAge4 () {
  this.age = 60;
  this.getAge5 = () => {
    console.log(person.getAge.call(this));
  }
}

new getAge4().getAge5();
console.log(age);
var age2 = 10;
var person2 = {
  age2: 20, getAge2: () => {
    var age2 = 30;
    return this.age2;
  },
};
console.log(person2.getAge2.call());
console.log(person2.getAge2.call(person2));
